package com.example.springLearning.part7.controller;

import com.example.springLearning.part7.service.ElectricService;
import com.example.springLearning.part7.service.Fixed2ElectricService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/spring/part7")
public class HelloWordController {

    @Autowired
    ElectricService electricService;

    @Autowired
    Fixed2ElectricService fixed2ElectricService;

    @RequestMapping(path = "charge", method = RequestMethod.GET)
    public void charge() throws Exception {
        electricService.charge();
    }

    @RequestMapping(path = "charge2", method = RequestMethod.GET)
    public void charge2() throws Exception {
        fixed2ElectricService.charge();
    }

    @RequestMapping(path = "charge3", method = RequestMethod.GET)
    public void charge3() throws Exception {
        fixed2ElectricService.charge();
    }
}
